home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13497 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: erich.triumf.ca!bennett
  2. From: bennett@erich.triumf.ca (P.Bennett)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: File problem with Watcom C/C++ 10.5
  5. Date: 7 Apr 1996 21:15 PST
  6. Organization: TRIUMF: Tri-University Meson Facility
  7. Distribution: world
  8. Message-ID: <7APR199621150113@erich.triumf.ca>
  9. References: <4k9fds$4fs@sparcserver.lrz-muenchen.de>
  10. NNTP-Posting-Host: erich.triumf.ca
  11. News-Software: VAX/VMS VNEWS 1.50    
  12.  
  13. In article <4k9fds$4fs@sparcserver.lrz-muenchen.de>, Ralph Reichart <reichart@informatik.tu-muenchen.de> writes...
  14. >hi,
  15. >i have a big problem. i'm trying to open a file with fopen. the program 
  16. >looks like this:
  17. ...
  18. > Datei = fopen("\autoexec.bat", "r");
  19.  
  20. remember that '\' is a special character in C strings (it and the following
  21. char make a non-printing char).  '\a' happens to produce the Bell char, which
  22. is not a valid char in a filename.  To actually put a '\' in a string, you need
  23. to use two, thus: '\\', so you need to say:
  24.     Datei = fopen("\\autoexec.bat","r");
  25. Or, since it is really only DOS's command line that requires the '\', you can
  26. say:
  27.     Datei = fopen"/autoexec.bat","r");
  28.  
  29.  
  30. Peter Bennett VE7CEI                | Vessels shall be deemed to be in sight
  31. Internet: bennett@triumf.ca         | of one another only when one can be
  32. Packet: ve7cei@ve7kit.#vanc.bc.ca   | observed visually from the other
  33. TRIUMF, Vancouver, B.C., Canada     |                          ColRegs 3(k)
  34. GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
  35. or: ftp://ftp-i2.informatik.rwth-aachen.de/pub/arnd/GPS/peter/index.html
  36.  
  37.  
  38.  
  39.  
  40.